package mp.codegenerator;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

public class Boot {

    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:postgresql://10.1.125.66:5432/fiberfactory", "fiberfactory", "fiberfactory@123")
                .globalConfig(builder -> {
                    builder.author("jiangz") // 设置作者
                            .enableSwagger() // 开启 swagger 模式
                            .fileOverride() // 覆盖已生成文件
                            .outputDir("D://mp.test"); // 指定输出目录
                })
                .strategyConfig(builder -> {
                    builder.addInclude("config", "employee");
                })
                .packageConfig(builder -> {
                    builder.parent("summer") // 设置父包名
                            .moduleName("mp.test") // 设置父包模块名
                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml, "D://mp.test"));
                })
                .execute();
    }
}
